use crate::rsync::{SaveRsyncData, RsyncManager};

use super::{RouterBuilder, utils::LibraryRequest};

pub(crate) fn mount() -> RouterBuilder {
    return RouterBuilder::new()
        .library_query("all", |t| {
            t(|_, _:(), library| async move {
                Ok(RsyncManager::all(library.db).await?)
            })
        })
        .library_mutation("save", |t| {
            t(|_, args: SaveRsyncData, library| async move {
                Ok(RsyncManager::save(library.db, args).await?)
            })
        })
}
